from toee import *
from utilities import *

def san_dialog( attachee, triggerer ):
	if (attachee.has_met(triggerer)):
		triggerer.begin_dialog( attachee, 40 )
	else:
		triggerer.begin_dialog( attachee, 30 )	
	return SKIP_DEFAULT

def san_dying( attachee, triggerer ):
	if (game.global_flags[862] == 0 and attachee.name == 14501):
		game.global_flags[862] = 1
	game.global_vars[23] = game.global_vars[23] + 1
	if (game.global_vars[23] >= 1):
		game.party[0].reputation_add( 1 )
	return RUN_DEFAULT

def switch_to_tarah( attachee, triggerer, line):
	npc = find_npc_near(attachee,8805)
	kent = find_npc_near(attachee,8071)
	if (npc != OBJ_HANDLE_NULL):
		triggerer.begin_dialog(npc, line)
		npc.turn_towards(kent)
		kent.turn_towards(npc)
	return SKIP_DEFAULT
